﻿using CustomerService;
using J.CustomerGet.Application.Command.CustomerListCommand;
using J.CustomerModel;
using MediatR;

namespace J.CustomerGet.Application.CommandHandler.CustomerListCommandHandler
{
    public class CustomerDetailsCommandHandler : IRequestHandler<CustomerDetailsCommand, CustomerList>
    {
        private readonly ICustomerListService _customerListService;
        public CustomerDetailsCommandHandler(ICustomerListService customerListService)
        {
            _customerListService = customerListService;
        }
        public async Task<CustomerList> Handle(CustomerDetailsCommand request, CancellationToken cancellationToken)
        {
            return await _customerListService.CustomerDetail(request.id);
        }
    }
}
